class Solution {
public:
    bool repeatedSubstringPattern(string s) {
        if (s.length() == 1) { return false; }
        string a;
        for (int i = 0; i <= s.length() / 2 - 1; i++) {
            a += s[i];
            string temp;
            while (temp.length() < s.length()) {
                temp += a;
            }
            if (temp.compare(s) == 0) { return true; }
        }
        return false;
    }
};